package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

@Repository
public interface BrandMapper extends Mapper<Brand> {

    /**
     * 根据分类名称，查询品牌信息
     */
    @Select("SELECT b.* from tb_category c, tb_category_brand cb, tb_brand b where c.id = cb.category_id and b.id = cb.brand_id and c.`name` = #{categoryName}")
    public List<Map> findBrandByCategoryName(@Param("categoryName") String categoryName);
}
